package top.porchwood.jweb.mcsm;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import top.porchwood.jweb.mcsm.util.ApplicationInit;

public class ServletInitializer extends SpringBootServletInitializer {
	private static final Logger logger = LogManager.getLogger();
	/**
	 * 作为War模式从Servlet启动
	 * @param application SpringApplicationBuilder
	 * @return SpringApplicationBuilder
	 */
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		ApplicationInit.CheckFristLaunch();
		logger.info("Hello World");
		return application.sources(MCSMApplication.class);
	}

}
